package com.fita.entity.car;

import com.demo2do.core.utils.Alias;
import org.apache.commons.lang3.StringUtils;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("VehicleSize")
public enum VehicleSize {
    
    S1("1", "Mini", "迷你型", "M"),
    
    S3("3", "Economy", "经济型", "E"),
    
    S4("3", "Compact", "紧凑型", "C"),
    
    S6("6", "Intermediate", "中型", "I"),
    
    S7("7", "Standard", "标准型", "S"),
    
    S8("8", "Full-size", "大型", "F"),
    
    S9("9", "Luxury", "奢华型", "L"),
    
    S10("10", "Premium", "高级型", "P"),
    
    S32("32", "Special", "特殊型", "X"),
    
    S33("33", "Mini elite", "迷你电动", "N"),
    
    S34("34", "Economy elite", "经凑电动", "H"),
    
    S35("35", "Compact elite", "经济电动", "D"),
    
    S36("36", "Intermediate elite", "中型电动", "J"),
    
    S37("37", "Standard elite", "标准电动", "R"),
    
    S38("38", "Fullsize elite", "全尺寸电动", "G"),
    
    S39("39", "Premium  elite", "高级电动", "U"),
    
    S40("40", "Luxury elite", "高级电动", "W"),
    
    S41("40", "Oversize", "豪华电动", "O");
    
    private String code;
    
    private String englishName;
    
    private String chineseName;
    
    private String ssip;
    
    /**
     * 
     * @param code
     * @param english
     * @param chinese
     * @param ssip
     */
    private VehicleSize(String code, String english, String chinese, String ssip) {
        this.code = code;
        this.englishName = english;
        this.chineseName = chinese;
        this.ssip = ssip;
    }
    
    /**
     * 
     * @param code
     * @return
     */
    public static  VehicleSize codeOf(String code) {
        for(VehicleSize size: VehicleSize.values()) {
            if(StringUtils.equalsIgnoreCase(size.getCode(), code)) {
                return size;
            }
        }
        return null;
    }
    
    /**
     * @param ssip
     * @return
     */
    public static VehicleSize ssipOf(String ssip) {
    	for(VehicleSize size: VehicleSize.values()) {
            if(StringUtils.equalsIgnoreCase(size.getSsip(), ssip)) {
                return size;
            }
        }
        return null;
    }
    
    public String getChineseName() {
        return chineseName;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getEnglishName() {
        return englishName;
    }
    
    public String getSsip() {
        return ssip;
    }

}
